package com.icinfo.cloud.provider.punish.api.controller;

import com.icinfo.cloud.common.core.page.PageResponse;
import com.icinfo.cloud.provider.common.constant.Constant;
import com.icinfo.cloud.provider.punish.api.dto.*;
import com.icinfo.cloud.provider.punish.api.service.IPunishCaseMainInfoService;
import com.icinfo.cloud.provider.punish.api.vo.*;
import com.icinfo.cloud.provider.punish.approval.dto.MemberUserVo;
import com.icinfo.framework.common.web.Result;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 描述：对外部授权应用提供的获取案件信息Controller
 *
 * @author zhengqiang
 * @description
 * @date 2023/4/18
 */
@RestController
@RequestMapping("/punish/api/case")
public class PunishCaseMainInfoController {

    @Resource
    private IPunishCaseMainInfoService punishCaseMainInfoService;

    /**
     * 【V1.11.4】描述：案件列表分页查询(成品油)
     *
     * @author: zhengqiang
     * @date: 2023/4/18
     * @param: pageListQueryDto
     * @return {@link PageResponse<  CaseInfoPageListForOilVo >}
     **/
    @PostMapping(value = "/getCaseInfoPageListForOilManage")
    public Result<PageResponse<CaseInfoPageListForOilVo>> getCaseInfoPageListForOilManage(@Validated @RequestBody CaseInfoPageListForOilQueryDto pageListQueryDto){
        List<CaseInfoPageListForOilVo> caseInfoPageList = punishCaseMainInfoService.getCaseInfoPageListForOilManage(pageListQueryDto);
        return Result.success(Constant.STRING_GET_SUCCESS, new PageResponse<>(caseInfoPageList));
    }

    /**
     * 【V1.11.4】描述：根据登录人及案件名称查询案件列表(成品油)--不分页
     *
     * @author: zhengqiang
     * @date: 2023/4/18
     * @param: queryDto
     * @return {@link Result< List< CaseNameAndNoListForOilVo>>}
     **/
    @PostMapping(value = "/getCaseInfoListByCaseNameForOilManage")
    public Result<List<CaseNameAndNoListForOilVo>> getCaseInfoListByCaseNameForOilManage(@Validated @RequestBody CaseNameAndNoListForOilQueryDto queryDto){
        List<CaseNameAndNoListForOilVo> caseInfoList = punishCaseMainInfoService.getCaseNameAndNoListForOilManage(queryDto);
        return Result.success(caseInfoList);
    }

    /**
     * 【V1.11.4】描述：根据登录人及案件编号列表查询案件列表(成品油)--不分页
     *
     * @author: zhengqiang
     * @date: 2023/4/18
     * @param: queryDto
     * @return {@link Result< List< CaseInfoPageListForOilVo>>}
     **/
    @PostMapping(value = "/getCaseInfoListByCaseNoListForOilManage")
    public Result<List<CaseInfoPageListForOilVo>> getCaseInfoListByCaseNoListForOilManage(@Validated @RequestBody CaseInfoListForOilQueryDto queryDto){
        List<CaseInfoPageListForOilVo> caseInfoList = punishCaseMainInfoService.getCaseInfoListByCaseNoListForOilManage(queryDto);
        return Result.success(caseInfoList);
    }

    /**
     * 【V1.11.4】描述：获取案件当事人信息(成品油)
     *
     * @author: zhengqiang
     * @date: 2023/4/18
     * @param: queryDto
     * @return {@link Result< CasePartyInfoForOilVo>}
     **/
    @PostMapping(value = "/getCasePartyListForOilManage")
    public Result<CasePartyInfoForOilVo> getCasePartyListForOilManage(@Validated @RequestBody CasePartyListForOilQueryDto queryDto){
        CasePartyInfoForOilVo casePartyList = punishCaseMainInfoService.getCasePartyListForOilManage(queryDto);
        return Result.success(casePartyList);
    }
    /**
     * 根据角色id 与部门编码获取用户信息
     * @author liyafeng
     * @date 2023/4/19
      * @param queryDto
     * @return {@link Result< CasePartyInfoForOilVo>}
     */
    @PostMapping(value = "/getUserListForOilManageByRole")
    public Result<List<MemberUserVo>> getUserListForOilManageByRole(@Validated @RequestBody UserListForOilQueryDto queryDto){
        List<MemberUserVo> userForOilVoList = punishCaseMainInfoService.getUserListForOilManageByRole(queryDto);
        return Result.success(userForOilVoList);
    }

    /**
     * 描述： 分页查询实施行政强制措施决定书记录
     *
     * @author: zhengqiang
     * @date: 2023/5/24
     * @param: pageListQueryDto
     * @return {@link Result< PageResponse< CaseEnforceDocForOilVo>>}
     **/
    @PostMapping(value = "/getCaseEnforceDocPageListForOilManage")
    public Result<PageResponse<CaseEnforceDocForOilVo>> getCaseEnforceDocPageListForOilManage(@Validated @RequestBody CaseEnforceDocPageListForOilQueryDto pageListQueryDto) {
        List<CaseEnforceDocForOilVo> enforceDocPageList = punishCaseMainInfoService.getCaseEnforceDocPageListForOilManage(pageListQueryDto);
        return Result.success(Constant.STRING_GET_SUCCESS, new PageResponse<>(enforceDocPageList));
    }

    /**
     * 描述： 根据部门编码查询条线配置信息
     *
     * @author: zhengqiang
     * @date: 2023/5/24
     * @param: queryDto
     * @return {@link Result< List< LineInfoForOilVo>>}
     **/
    @PostMapping(value = "/getLineInfoForOilManage")
    public Result<List<LineInfoForOilVo>> getLineInfoForOilManage(@Validated @RequestBody LineInfoListForOilQueryDto queryDto) {
        List<LineInfoForOilVo> lineInfoList = punishCaseMainInfoService.getLineInfoForOilManage(queryDto);
        return Result.success(lineInfoList);
    }

}
